package com.ulic.customerManApplication.studentmodule.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ulic.customerManApplication.pager.PagerModel;
import com.ulic.customerManApplication.studentmodule.bo.Student;
import com.ulic.customerManApplication.studentmodule.dao.StudentDao;
import com.ulic.customerManApplication.studentmodule.service.StudentService;
import com.ulic.customerManApplication.studentmodule.vo.StudentVO;
import com.ulic.customerManApplication.usermodule.bo.User;
@Component("studentService")
public class StudentServiceImpl implements StudentService {

	private StudentDao studentDao;
	
	public StudentDao getStudentDao() {
		return studentDao;
	}
    @Resource
	public void setStudentDao(StudentDao studentDao) {
		this.studentDao = studentDao;
	}

	@Override
	public void addStudent(Student student) throws Exception {
		// TODO Auto-generated method stub

		studentDao.insertStudent(student);
	}

	@Override
	public void addStudents(List<Student> students) throws Exception {
		// TODO Auto-generated method stub

		studentDao.insertStudents(students);
	}

	@Override
	public Student getStudent(int id) {
		// TODO Auto-generated method stub
		return studentDao.getStudent(id);
	}

	@Override
	public void modifyStudent(Student student) throws Exception {
		// TODO Auto-generated method stub
         studentDao.updateStudent(student);
	}

	@Override
	public void removeStudent(Student student) throws Exception {
		// TODO Auto-generated method stub
		studentDao.deleteStudent(student);
	}
	@Override
	public PagerModel getStudents(int curPage) {
		return studentDao.getStudents(curPage);
	}
	@Override
	public PagerModel getStudents(StudentVO studentVO, int curPage) {
		return studentDao.getStudents(studentVO, curPage);
	}
	@Override
	public List<Student> getStudents(User user) {
		return studentDao.getStudents(user);
	}
	@Override
	public PagerModel getStudents(StudentVO studentVO, int curPage, int totalNum) {
		return studentDao.getStudents(studentVO, curPage, totalNum);
	}

}
